<div id="dvGuider">
<a href="1.html">1.html</a>
<a href="2.html">2.html</a>
<a href="3.html">3.html</a>
<a href="4.html">4.html</a>
</div>
<style>
a.focus{background:#ff0000;color:#ffffff;}
</style>
<script>
    var pn = location.pathname;
    console.log(pn);
    var as = document.getElementById('dvGuider').getElementsByTagName('a'),find=false;
    for (var i = 0, j = as.length; i < j; i++)
        if (as[i].href.indexOf(pn) != -1) { as[i].className = 'focus'; find = true; break; }
    //if (!find) as[0].className = 'focus';//如果未找到匹配的，需要设置哪个获取焦点可以修改这句
</script>